Hardware “threads” are hardware resources of processors that are able to perform separate streams of execution simultaneously with and independent of other processing executing on a computing device. To increase the execution speed and efficiency of computer programs by a computing device, the computer program can be executed by more than one hardware thread and the computing device switches between the hardware threads. However, the increase in execution speed and efficiency of executing computer programs utilizing multiple hardware threads is offset against the synchronization overhead, i.e. the resources that must expended in communicating among the various hardware threads.
Conventional hardware threads have limited resources available for execution and thus typically are limited in the amount of computational work they can perform. This limitation can be mitigated to an extent by increasing the number of hardware threads utilized to execute a computer program. However, current implementations of hardware threads typically communicate and synchronize through memory operations, and thus have high communication and synchronization overheads. The larger the communication and synchronization overhead, the more work each hardware thread has to perform in order for execution of a computer program utilizing multiple threads to be worthwhile.
Typically, computer program code is written to execute using a single hardware thread or multiple hardware threads. Computer programs written to execute using only a single hardware thread are unable achieve increased execution speed and efficiency by executing using multiple hardware threads, even when the benefits outweigh the costs. Computer programs written to execute using multiple hardware threads achieve increased execution speed and efficiency by executing using multiple hardware threads when the benefits in increased execution speed and efficiency outweigh the costs of synchronization, but are sometimes unable to avoid the drawbacks of executing using multiple hardware threads when the benefits in increased execution speed do not outweigh the costs of synchronization and communication. Further, computer programs written to execute using multiple hardware threads are usually unable to avoid other drawbacks of executing using multiple threads, such as when a sufficient number of hardware threads are not available and execution is thus delayed in waiting for available threads.